<?php

/**
 * 预约控制器:后台
 */
namespace App\Http\Controllers\Admin;

use App\Models\Appointment;

class AppointmentController extends BaseController
{

    public function __construct(Appointment $appointment)
    {
        parent::__construct();
        $this->appointment = $appointment;
    }

    /**
     * 后台显示订单主页
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function getIndex(){

        $res = $this->appointment->getAppointmentListAll(request());
        return view('admin.appointment.index',compact('res'));
    }

    public function postAppointmentInfo(){
         $res = $this->appointment->addAppPointmentStep1(request());
         return ajax_return($res);
    }

    public function getAppointmentInfo(){
        $res = $this->appointment->addAppPointmentStep2();
        return ajax_return($res);
    }

    public function postAddAppointemtInfo(){
        $res = $this->appointment->addAppPointmentStep3();
        return ajax_return($res);
    }

    public function getDel(){
         $res = $this->appointment->delOrder(request('id'));
         return ajax_return($res);
    }

    public function getAppointmentList()
    {
        $res = $this->appointment->getAppointmentList(request());
        return ajax_return($res);
    }



}
